<template>
  <div class="titleSubColumn">
    <div class="titleName">
      <span :data-text="name">{{ name }}</span>
    </div>
    <div class="rightSlot"><slot></slot></div>
  </div>
</template>

<script lang="ts" setup>
  defineOptions({ name: 'TitleSubColumn' });
  defineProps({
    name: { type: String },
  });
</script>

<style lang="less" rel="stylesheet/less" scoped>
  .titleSubColumn {
    width: 100%;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    &::before {
      content: '';
      width: 16px;
      height: 16px;
      background: url(@/assets/images/title_decorate.png) no-repeat;
      background-size: contain;
    }
    &::after {
      content: '';
      width: 70%;
      height: 11px;
      background: linear-gradient(90deg, rgba(2, 110, 194, 0.55) 0.65%, rgba(6, 183, 253, 0) 107.02%);
      position: absolute;
      left: 12px;
    }
    .titleName {
      display: flex;
      align-items: center;
      width: 50%;
      position: absolute;
      left: 18px;
      span {
        display: inline-block;
        width: 100%;
        position: relative;
        font-size: 14px;
        font-weight: bold;
        font-style: italic;
        color: transparent;
        padding-right: 10px;
        letter-spacing: 1px;
        &::before {
          content: attr(data-text);
          width: 100%;
          position: absolute;
          top: 0;
          left: 0;
          z-index: 100;
          padding-right: 10px;
          background: linear-gradient(180deg, #FFFFFF 43.33%, #06B7FD 110%);
          -webkit-background-clip: text;
          color: transparent;
        }
        &::after {
          content: attr(data-text);
          width: 100%;
          position: absolute;
          top: 0;
          left: 0;
          z-index: 0;
          text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.8);
        }
      }
    }
    .rightSlot {
      max-width: 50%;
      position: absolute;
      right: 0;
    }
  }
</style>
